indirect function with sum functions